<html>
<head><meta charset="utf-8"><title>loading rustc sources in RA · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html">loading rustc sources in RA</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216257097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216257097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216257097">(Nov 10 2020 at 18:56)</a>:</h4>
<p>Hi, is there a better solution than <code>cfg(NOT_A_PLATFORM)</code> to load rustc sources in RA? It makes things non-portable and hard to share. If there's a config file i where i could give RA additional loadpaths that would solve all my problems (I could keep it out of git)</p>



<a name="216257183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216257183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216257183">(Nov 10 2020 at 18:56)</a>:</h4>
<p>also thanks for the work! I'm a recent convert but it's been a great experience so far!</p>



<a name="216257589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216257589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216257589">(Nov 10 2020 at 18:59)</a>:</h4>
<p>since my project is a rustc driver, I really need RA to find those crates (or it becomes useless) but having them in cargo.toml means I can't use CI or really ever have other contributors</p>



<a name="216260290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216260290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216260290">(Nov 10 2020 at 19:17)</a>:</h4>
<p>I am not aware about any hacks for supporting rustc driver use-case</p>



<a name="216260329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216260329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216260329">(Nov 10 2020 at 19:17)</a>:</h4>
<p>but that should be moderately easy to  support</p>



<a name="216260403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216260403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216260403">(Nov 10 2020 at 19:18)</a>:</h4>
<p>in <code>project_model</code>, we need to have a sepaate codepath to run <code>cargo metadata</code> on rustc's checkout, and plug that into crate graph</p>



<a name="216260983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216260983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216260983">(Nov 10 2020 at 19:22)</a>:</h4>
<p>I think my usecase is the same as anyone that wants to refer to an <code>extern crate</code> honestly</p>



<a name="216261113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216261113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216261113">(Nov 10 2020 at 19:24)</a>:</h4>
<p>I mean, for typical use-cases <code>cargo metadata</code> just works</p>



<a name="216261245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216261245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216261245">(Nov 10 2020 at 19:24)</a>:</h4>
<p>hmm right but that's derived from the Cargo.toml</p>



<a name="216261326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216261326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216261326">(Nov 10 2020 at 19:25)</a>:</h4>
<p>i wish that having the <code>rustc-dev</code> component would make those crates visible like normal ones...</p>



<a name="216261456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216261456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216261456">(Nov 10 2020 at 19:26)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133169">matklad</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/loading.20rustc.20sources.20in.20RA/near/216260403">said</a>:</p>
<blockquote>
<p>in <code>project_model</code>, we need to have a sepaate codepath to run <code>cargo metadata</code> on rustc's checkout, and plug that into crate graph</p>
</blockquote>
<p>this still comes back to how do you tell RA where the checkout is</p>



<a name="216261517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216261517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216261517">(Nov 10 2020 at 19:26)</a>:</h4>
<p>I tried using the <code>linkedProjects</code> functionality but it seems like it treats all the linked projects as actual parts of the project</p>



<a name="216261537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216261537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216261537">(Nov 10 2020 at 19:27)</a>:</h4>
<p>so the indexed crates went up from ~500 to 1700</p>



<a name="216261561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216261561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216261561">(Nov 10 2020 at 19:27)</a>:</h4>
<p>I mean, you need to write some code inside rust-analyzer to support this use-case</p>



<a name="216261638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216261638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216261638">(Nov 10 2020 at 19:27)</a>:</h4>
<p>it's not only the matter of telling ra where the crates are, you also need to explain that your crate depend on rustc's crate</p>



<a name="216261653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216261653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216261653">(Nov 10 2020 at 19:28)</a>:</h4>
<p>there's no sysroot in ra, all deps are explicit</p>



<a name="216261722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216261722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216261722">(Nov 10 2020 at 19:28)</a>:</h4>
<p>im happy to write code to make this happen!</p>



<a name="216261981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216261981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216261981">(Nov 10 2020 at 19:30)</a>:</h4>
<p>So, there are two bits where this needs to be handled</p>



<a name="216262000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216262000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216262000">(Nov 10 2020 at 19:30)</a>:</h4>
<p>(beyond threading various configs)</p>



<a name="216262042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216262042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216262042">(Nov 10 2020 at 19:30)</a>:</h4>
<p>This thing runs <code>cargo metadata</code> on your project, to learn about deps: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/5c06e820fa02b47a1550576f2a7071ff94fb0c64/crates/project_model/src/lib.rs#L157-L161">https://github.com/rust-analyzer/rust-analyzer/blob/5c06e820fa02b47a1550576f2a7071ff94fb0c64/crates/project_model/src/lib.rs#L157-L161</a></p>



<a name="216262062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216262062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216262062">(Nov 10 2020 at 19:30)</a>:</h4>
<p>You need to teach it to <em>also</em> run metadata on rustc_private crates</p>



<a name="216262130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216262130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216262130">(Nov 10 2020 at 19:31)</a>:</h4>
<p>I think the way to do that is to add a <code>rustc_source: Option&lt;AbsPathBuf&gt;</code> field to <code>CargoConfig</code> and then do the stuff</p>



<a name="216262137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216262137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216262137">(Nov 10 2020 at 19:31)</a>:</h4>
<p>k seems reasonable</p>



<a name="216262263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216262263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216262263">(Nov 10 2020 at 19:32)</a>:</h4>
<p>The second bit is this 120-lines long match arm :D</p>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/blob/5c06e820fa02b47a1550576f2a7071ff94fb0c64/crates/project_model/src/lib.rs#L368-L486">https://github.com/rust-analyzer/rust-analyzer/blob/5c06e820fa02b47a1550576f2a7071ff94fb0c64/crates/project_model/src/lib.rs#L368-L486</a></p>



<a name="216262321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216262321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216262321">(Nov 10 2020 at 19:32)</a>:</h4>
<p>Here, we lower cargo-metadata representation to our internal <code>CrateGraph</code>, which makes all the deps explicit</p>



<a name="216262408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216262408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216262408">(Nov 10 2020 at 19:33)</a>:</h4>
<p>Here, you'd need to graft rustc's crate onto vanila cargo metadata</p>



<a name="216262690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216262690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216262690">(Nov 10 2020 at 19:35)</a>:</h4>
<p>k well i'll go work on that right now</p>



<a name="216263275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263275">(Nov 10 2020 at 19:39)</a>:</h4>
<p>hmm what's the best way to discover the path for the rustc-dev component...</p>



<a name="216263293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263293">(Nov 10 2020 at 19:39)</a>:</h4>
<p>RA doesn't assume things were installed from rustup does it?</p>



<a name="216263420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263420">(Nov 10 2020 at 19:40)</a>:</h4>
<blockquote>
<p>hmm what's the best way to discover the path for the rustc-dev component...</p>
</blockquote>
<p>I'd go just for a value in configuration file</p>



<a name="216263468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263468">(Nov 10 2020 at 19:40)</a>:</h4>
<p>You need some config to opt-in into this value anyway, so might as well require the user to supply the full path</p>



<a name="216263504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263504">(Nov 10 2020 at 19:41)</a>:</h4>
<p>yea, that's fine but that value can't be in <code>Cargo.toml</code></p>



<a name="216263520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263520">(Nov 10 2020 at 19:41)</a>:</h4>
<p>or it's self-defeating</p>



<a name="216263551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263551">(Nov 10 2020 at 19:41)</a>:</h4>
<p>I mean, it should work just all the other configs</p>



<a name="216263566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263566">(Nov 10 2020 at 19:41)</a>:</h4>
<p>Take a look how <code>CargoConfig</code> is populated</p>



<a name="216263578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263578">(Nov 10 2020 at 19:41)</a>:</h4>
<p>(in <code>config.rs</code>)</p>



<a name="216263583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263583">(Nov 10 2020 at 19:41)</a>:</h4>
<p>yea that's what im reading rn</p>



<a name="216263597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263597">(Nov 10 2020 at 19:41)</a>:</h4>
<p>RA works fine on this project ;)</p>



<a name="216263658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263658">(Nov 10 2020 at 19:42)</a>:</h4>
<p>(yet again I need someone to implement <a href="https://github.com/rust-analyzer/rust-analyzer/issues/2549">https://github.com/rust-analyzer/rust-analyzer/issues/2549</a> :D )</p>



<a name="216263751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216263751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216263751">(Nov 10 2020 at 19:42)</a>:</h4>
<p>aha yea i was just thinking how useful that would be</p>



<a name="216279918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216279918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216279918">(Nov 10 2020 at 21:53)</a>:</h4>
<p>hmm is it wrong of me to load the rustc compiler into a <code>CargoWorkspace</code> ?</p>



<a name="216279983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216279983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216279983">(Nov 10 2020 at 21:54)</a>:</h4>
<p>or should I really manually iterate over the crates in the <code>compiler/</code> directory and manually build the graph entries?</p>



<a name="216280103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280103">(Nov 10 2020 at 21:55)</a>:</h4>
<p>it seems like running <code>cargo metadata</code> anywhere in the workspace returns the same info (which I guess is expected)</p>



<a name="216280287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280287">(Nov 10 2020 at 21:56)</a>:</h4>
<p>Loading it into CargoWOrkspace seems correct</p>



<a name="216280353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280353">(Nov 10 2020 at 21:57)</a>:</h4>
<p>So, you'll have something like</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#[derive(Clone, Eq, PartialEq)]</span><span class="w"></span>
<span class="k">pub</span><span class="w"> </span><span class="k">enum</span> <span class="nc">ProjectWorkspace</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="sd">/// Project workspace was discovered by running `cargo metadata` and `rustc --print sysroot`.</span>
<span class="w">    </span><span class="n">Cargo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">cargo</span>: <span class="nc">CargoWorkspace</span><span class="p">,</span><span class="w"> </span><span class="n">sysroot</span>: <span class="nc">Sysroot</span><span class="p">,</span><span class="w"> </span><span class="n">rustc</span>: <span class="nb">Option</span><span class="o">&lt;</span><span class="n">CargoWorkspace</span><span class="o">&gt;</span><span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="w">    </span><span class="sd">/// Project workspace was manually specified using a `rust-project.json` file.</span>
<span class="w">    </span><span class="n">Json</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">project</span>: <span class="nc">ProjectJson</span><span class="p">,</span><span class="w"> </span><span class="n">sysroot</span>: <span class="nb">Option</span><span class="o">&lt;</span><span class="n">Sysroot</span><span class="o">&gt;</span><span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="216280590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280590">(Nov 10 2020 at 22:00)</a>:</h4>
<p>yep!</p>



<a name="216280644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280644">(Nov 10 2020 at 22:00)</a>:</h4>
<p>i got all of that working but it seems to load WAY too many packages now</p>



<a name="216280659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280659">(Nov 10 2020 at 22:00)</a>:</h4>
<p>~2307</p>



<a name="216280671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280671">(Nov 10 2020 at 22:00)</a>:</h4>
<p>Well, <code>rustc</code> is big :-)</p>



<a name="216280696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280696">(Nov 10 2020 at 22:00)</a>:</h4>
<p>previously using the <code>NOT_A_TARGET</code> hack it was around ~400</p>



<a name="216280704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280704">(Nov 10 2020 at 22:00)</a>:</h4>
<p>Although, yeah, 2307 seems a bit too much</p>



<a name="216280723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280723">(Nov 10 2020 at 22:00)</a>:</h4>
<p>around 400 sounds closer to right, yeah</p>



<a name="216280737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280737">(Nov 10 2020 at 22:00)</a>:</h4>
<p>is it maybe loading some packages twice?</p>



<a name="216280750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280750">(Nov 10 2020 at 22:01)</a>:</h4>
<p>which is weird cuz the <code>cargo metadata</code> is ~400</p>



<a name="216280794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280794">(Nov 10 2020 at 22:01)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/loading.20rustc.20sources.20in.20RA/near/216280737">said</a>:</p>
<blockquote>
<p>is it maybe loading some packages twice?</p>
</blockquote>
<p>sounds probable... what's the best way to see all the packages that were loaded?</p>



<a name="216280904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280904">(Nov 10 2020 at 22:02)</a>:</h4>
<p>I like <code>jq</code> :P</p>



<a name="216280946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216280946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216280946">(Nov 10 2020 at 22:02)</a>:</h4>
<blockquote>
<p>sounds probable... what's the best way to see all the packages that were loaded?</p>
</blockquote>
<p>probably just <code>dbg!(workspace)</code>?</p>



<a name="216281020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216281020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216281020">(Nov 10 2020 at 22:03)</a>:</h4>
<p>there's also some logging this this module, but I don't think we dump the whole projst structure anywahre</p>



<a name="216281170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216281170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216281170">(Nov 10 2020 at 22:04)</a>:</h4>
<p>yea the logs just go by so fast</p>



<a name="216281264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216281264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216281264">(Nov 10 2020 at 22:05)</a>:</h4>
<p>You need to filter by module to get any kind of useful logs</p>



<a name="216281312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216281312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216281312">(Nov 10 2020 at 22:06)</a>:</h4>
<p>otherwise, you'll be swamped with chalk/salsa output</p>



<a name="216281429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216281429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216281429">(Nov 10 2020 at 22:07)</a>:</h4>
<p>Just saw the PR, its on the right track!</p>



<a name="216281645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216281645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216281645">(Nov 10 2020 at 22:08)</a>:</h4>
<p>just need to get it working!</p>



<a name="216281701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216281701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216281701">(Nov 10 2020 at 22:09)</a>:</h4>
<p>The tricky part, yeah</p>



<a name="216281931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216281931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216281931">(Nov 10 2020 at 22:11)</a>:</h4>
<p>interesting.... the workspace has the correct number of entries (488)</p>



<a name="216282070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216282070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216282070">(Nov 10 2020 at 22:12)</a>:</h4>
<p>anyways... time to debug!</p>



<a name="216283131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216283131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216283131">(Nov 10 2020 at 22:23)</a>:</h4>
<p>yea that's what I thought the problem is the <code>crate x target</code> multiplication</p>



<a name="216283246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216283246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216283246">(Nov 10 2020 at 22:24)</a>:</h4>
<p>i just need to rule out non-current targets and it should be good</p>



<a name="216283431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216283431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216283431">(Nov 10 2020 at 22:26)</a>:</h4>
<p><span class="user-mention" data-user-id="312719">@Xavier Denis</span> yeah, there's similar logic in that we only create library targets for non-current-ws crates</p>



<a name="216283934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216283934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216283934">(Nov 10 2020 at 22:31)</a>:</h4>
<p>yea im skipping all targets other than lib and that seems to fix it</p>



<a name="216283996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216283996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216283996">(Nov 10 2020 at 22:32)</a>:</h4>
<p>I'll refactor everything tomorrow morning and push a revised PR</p>



<a name="216287692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216287692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216287692">(Nov 10 2020 at 23:11)</a>:</h4>
<p>ok i have a _janky_ version that works locally! i'll clean it up in the AM but hey! it works!</p>



<a name="216288735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216288735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216288735">(Nov 10 2020 at 23:24)</a>:</h4>
<p><span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<a name="216337071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/loading%20rustc%20sources%20in%20RA/near/216337071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/loading.20rustc.20sources.20in.20RA.html#216337071">(Nov 11 2020 at 12:06)</a>:</h4>
<p>ok, i tried cleaning it up a bit, not sure about how testing works for something like this</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>